package myactionplugin;

import com.nomagic.actions.ActionsCategory;
import com.nomagic.actions.NMAction;
import com.nomagic.magicdraw.actions.ActionsConfiguratorsManager;
import com.nomagic.magicdraw.plugins.Plugin;

/**
 * 
* <p>Title:ActionTest </p>
* <p>Description:定义了插件的主类 </p>
* <p>Company: </p> 
* @author 二胡
* @date 2018-7-17上午10:24:13
 */
public class ActionTest  extends Plugin{

	public boolean close() {
		return true;
	}

	public void init() {
		ActionsConfiguratorsManager manager = ActionsConfiguratorsManager.getInstance();
		manager.addMainMenuConfigurator(new MainMenuConfigurator(getSubmenuActions()));
	
	}

	public boolean isSupported() {
		return true;
	}

	
	private NMAction getSubmenuActions()
	{
		ActionsCategory category = new ActionsCategory(null, "Quick reverse");
		// this call makes submenu.
		category.setNested(true);
		category.addAction(new SimpleAction(null, "to TDL and Java"));
		//category.addAction(new SimpleAction(null, "SubAction2"));
		return category;
	}
	
}
